<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>  
    <body class="tundra">
         <div id="searchuser">
             <label for="username">按公司名检索:</label>
             <input name="username" dojoType="dijit.form.TextBox" jsId="searchuser_username" value="" intermediateChanges="true" trim="true" required="true">
             <button dojoType="dijit.form.Button" type="submit" name="submitButton" value="Submit">添加
                <script type="dojo/method" event="onClick">
                  searchUserForTable();
                </script>
             </button>
        </div>

    
        <span dojoType="dojo.data.ItemFileWriteStore" jsId="listcompanystore" url="searchuser.action?currentPage=0">
        </span>
        <div id="gridDiv" style="width: 100%; height: 100%;">
        </div>
    </body>
    <script type="text/javascript">
        var _dr = dojo.require;
        dojo.require = function(module) {
            if (module == "dijit.Editor") return;
            _dr(module);
        }

        dojo.require("dojox.grid.EnhancedGrid");
        dojo.require("dojox.grid.enhanced.plugins.DnD");
        dojo.require("dojox.grid.enhanced.plugins.Menu");
        dojo.require("dojox.grid.enhanced.plugins.NestedSorting");
        dojo.require("dojox.grid.enhanced.plugins.IndirectSelection");
        dojo.require("dojox.data.CsvStore");
        dojo.require("dojox.grid.DataGrid");
        dojo.require("dojo.data.ItemFileWriteStore");
        dojo.addOnLoad(function() {
            // set the layout structure:
            var layout = [{
                field: 'Title',
                name: 'Title of Movie',
                width: '200px'
            },
            {
                field: 'Year',
                name: 'Year',
                width: '50px'
            },
            {
                field: 'Producer',
                name: 'Producer',
                width: 'auto'
            }];

            // create a new grid:
            var grid = new dojox.grid.EnhancedGrid({
                query: {
                    Title: '*'
                },
                store: listcompanystore,
                rowSelector: '20px',
                structure: layout,
                plugins: {
                    nestedSorting: true,
                    dnd: true,
                    indirectSelection: {
                        name: "Selection",
                        width: "70px",
                        styles: "text-align: center;"
                    }
                }
            },
            document.createElement('div'));

            // append the new grid to the div "gridContainer4":
            dojo.byId("gridDiv").appendChild(grid.domNode);

            // Call startup, in order to render the grid:
            grid.startup();
        });
    </script>

</html>
